package com.cardone.common.io;

import javax.servlet.http.HttpServletResponse;
import java.io.*;

/**
 * Created by Administrator on 2014/12/3.
 */
public interface FsManager {
    /**
     * 保存文件
     *
     * @param inputStream 多文件
     * @param size
     *@param filename  @throws IOException
     */
    void saveFile(final InputStream inputStream, long size, final String filename, String contentType) throws IOException;

    /**
     * 保存文件
     *
     * @param inputStream 多文件
     * @param size
     *@param filename  @throws IOException
     */
    void saveFile(final InputStream inputStream, long size, final String filename) throws IOException;

    /**
     * 写入文件
     *
     * @param toOutputStream
     * @param filename
     * @throws IOException
     */
    void writeTo(final OutputStream toOutputStream, final String filename) throws IOException;

    /**
     * 写入流
     *
     * @param response
     * @param filename 文件名
     * @throws IOException
     */
    void writeTo(final HttpServletResponse response, final String filename) throws IOException;

    /**
     * 写入流
     *
     * @param toFilename
     * @param filename
     * @throws IOException
     */
    void writeTo(final String toFilename, final String filename) throws IOException;

    /**
     * 写入文件
     *
     * @param toFile
     * @param filename
     * @throws IOException
     */
    public void writeTo(final File toFile, final String filename) throws IOException;
}
